package gameStream.display
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	
	import org.gof.display.IDisplayData;
	import org.gof.display.IGODisplayPosition;
	import org.gof.display.IRenderer;
	
	public class BallRenderer implements IRenderer
	{
		
		private var viewPort:DisplayObjectContainer;
		private var sprites:Vector.<Sprite>;
		public function render():void
		{
		}
		
		public function addObject(name:String, position:IGODisplayPosition, initialDisplayData:IDisplayData):Object
		{
		//	trace ("BallREnderer.addObject");
			var displaySprite:Sprite = (initialDisplayData as BallDisplayData).sprite;
			displaySprite.x = (position as BallPosition).x;
			displaySprite.y = (position as BallPosition).y;
			sprites.push(displaySprite);	
			
			return null;
		}
		
		public function updatePosition(newPosition:IGODisplayPosition, index:uint):void
		{
		 //   trace ("BallRenderer.updatePosition: " + newPosition);
			
			
			sprites[index].x = (newPosition as BallPosition).x;
			sprites[index].y = (newPosition as BallPosition).y;
		}
		
		public function BallRenderer(rootContainer:DisplayObjectContainer):void
		{
			this.viewPort = rootContainer;
			sprites = new Vector.<Sprite>();
		}
		
		public function get rootContainer():DisplayObjectContainer
		{
			return null;
		}
		
		public function disposeAllObjects():void
		{
		}
	}
}